package com.meihua.workflow.controller;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;

import com.meihua.workflow.constants.R;
import com.meihua.workflow.model.SysUser;
import com.meihua.workflow.service.SysUserService;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

@RestController
@RequestMapping("/user")
public class SysUserController {
    @Resource
    private SysUserService sysUserService;
    @GetMapping("/userPage")
    public R userPage(@RequestParam(value = "pageNo",defaultValue = "1",required = false) Integer pageNo,
                      @RequestParam(value = "pageSize",defaultValue = "10",required = false) Integer pageSize){
        IPage<SysUser> userPage = new Page<>(pageNo, pageSize);
        return R.success(this.sysUserService.page(userPage));
    }
}
